import request from '@/utils/request'
import Qs from 'qs'

// export function login(username, password) {
//     return axios({
//         url: 'http://localhost:8081/api/user/launcher',
//         method: 'post',
//         data: Qs.stringify({
//             telephone: username,
//             password
//         }),
//         headers: {
//             'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
//         },
//         withCredentials: true
//     }
//     )
// }

export function login(username, password) {
    return request({
        url: '/user/launcher',
        method: 'post',
        data: Qs.stringify({
            telephone: username,
            password
        })
    })
}

export function getInfo() {
    return request({
        url: '/user/info',
        method: 'get'
    })
}

export function logout() {
    return request({
        url: '/user/logout',
        method: 'post'
    })
}
